dnl
dnl CHECKS_BUILD_MODE
dnl
AC_DEFUN([CHECKS_BUILD_MODE],
[
AC_ARG_WITH(mode,
    [AC_HELP_STRING([--with-mode=RELEASE|DEBUG], [release or debug build])],
    [case "$withval" in
        DEBUG) with_mode = $withval;;
        RELEASE) with_mode = $withval;;
        *) AC_MSG_ERROR(bad value $withval for --with-mode);;
    esac],
    [if test -d ".seba"; then
        with_mode = DEBUG
    else
        with_mode = RELEASE
    fi])
])


dnl
dnl SETS_BUILD_MODE
dnl
AC_DEFUN([SETS_BUILD_MODE],
[
    if test "$with_mode" = "DEBUG"; then
      CXXFLAGS = "-g -O0 -fno-inline -DDEBUG"
      AC_MSG_RESULT([])
      AC_MSG_RESULT([-- !!!!!!!!!!!!!!!!!!!!!!! --])
      AC_MSG_RESULT([!!!    Debug Build        !!!])
      AC_MSG_RESULT([-- !!!!!!!!!!!!!!!!!!!!!!! --])
      AC_MSG_RESULT([])
    elseif test "$with_mode" = "RELEASE"; then
      CXXFLAGS = "-g -O2 -DRELEASE"
      AC_MSG_RESULT([])
      AC_MSG_RESULT([-- !!!!!!!!!!!!!!!!!!!!!!! --])
      AC_MSG_RESULT([!!!    Release Build      !!!])
      AC_MSG_RESULT([-- !!!!!!!!!!!!!!!!!!!!!!! --])
      AC_MSG_RESULT([])
    fi
])
